package com.swingolf.web;

import com.swingolf.model.Level;
import org.springframework.core.convert.converter.Converter;
import org.springframework.util.StringUtils;

public class LevelConverter implements Converter<String, Level> {

  public Level convert(String s) {
    if (!StringUtils.hasText(s)) {
      return null;
    }
    ;
    return Level.valueOf(s);
  }
}
